import request, {get, post} from '../utils/request.js'
import {getEnv} from '../utils/env.js'

export function getTemplatesToCreateById(id){
  return get('/web/work-order/getTemplatesToCreateById',{
    id
  })
}

export function getWorkOrderInfo(data){
  return post('/web/work-order/getWorkOrderInfo',data)
}

export function getFillOut(params){
  return get('/web/work-order/getFillOut',params)
}

export function getDevice(){
  return get('/web/work-order/getDevice')
}

export function getConfig(configKey){
  let params = {
    configKey
  }
  return get('/web/work-order/getConfig', params)
}

export function getDeviceSystemType(configKey){
  return getConfig('device_system_type')
}

export function getDeviceType(configKey){
  return getConfig('device_type')
}

export function getOrg(data){
  return request({
    url: '/web/my-work-order/getOrg',
    method: 'post',
    headers: {
      repeatSubmit: false,
      showErrorMsg: false
    },
    data: {
      "treeType": "01",
      "orgType": "1",
      "flag": "1",
      "orgCode": "NG5596477",
      ...data
    }
  })
}
export function getUserInfo(){
  return get('/web/work-order/getCurrent')
}
export function getUserList(data){
  return post('/web/work-order/getUser',data)
}
